from enum import Enum

class Greeting(Enum):
    """枚举类用于表示不同的问候语"""

    HI = "Hello"
    HELLO = "Hi"
    GOOD_MORNING = "Good morning"
    GOOD_AFTERNOON = "Good afternoon"
    GOOD_EVENING = "Good evening"


class Code(Enum):
    """枚举类用于表示不同的状态或错误代码"""

    SUCCESS = 0
    INVALID_INPUT = 1
    RESOURCE_NOT_FOUND = 2
    INTERNAL_SERVER_ERROR = 500

    def is_success(self) -> bool:
        """判断当前枚举成员是否代表成功状态"""
        return self == Code.SUCCESS


# 使用枚举示例
def greet_someone(time_of_day: str, greeting_type: Greeting) -> None:
    """根据时间向某人发出特定的问候"""
    print(f"At {time_of_day}, let me greet you with: {greeting_type.value}")


def handle_response_code(code: Code) -> None:
    """处理响应状态码"""
    if code.is_success():
        print("Request processed successfully.")
    else:
        print(f"Error occurred: {code.name} ({code.value})")